home *** CD-ROM | disk | FTP | other *** search
/ Network Support Library / RoseWare - Network Support Library.iso / apidev / tpapi.exe / EXAMPLES / CHKSERVE.PAS < prev    next >
Pascal/Delphi Source File  |  1994-01-14  |  3KB  |  68 lines

  1. {***************************************************************************}
  2. {** Program : CHKSERVE                                                    **}
  3. {***************************************************************************}
  4. {** Version : 1.0             ** Started :           ** Ended :           **}
  5. {***************************************************************************}
  6. {******************************** Description ******************************}
  7. {***************************************************************************}
  8. {** Program to check to see if a specified server exists.                 **}
  9. {**                                                                       **}
  10. {**                                                                       **}
  11. {**                                                                       **}
  12. {**                                                                       **}
  13. {**                                                                       **}
  14. {**                                                                       **}
  15. {**                                                                       **}
  16. {***************************************************************************}
  17. {******************************** Information ******************************}
  18. {***************************************************************************}
  19. {**                                                                       **}
  20. {**                                                                       **}
  21. {**                                                                       **}
  22. {**                                                                       **}
  23. {**                                                                       **}
  24. {**                                                                       **}
  25. {***************************************************************************}
  26.  
  27. program CHKSERVE;
  28.  
  29. uses
  30.  
  31.   nwvar,
  32.   nwmisc
  33.   ;
  34.  
  35. var
  36.  
  37.   MNW : MiscFuncObj;
  38.  
  39. procedure CheckCmdLine;
  40.  
  41. begin
  42.  
  43.   if paramcount < 1 then
  44.     begin
  45.  
  46.       writeln;
  47.       writeln ('USAGE : [servername]');
  48.       writeln;
  49.       halt;
  50.  
  51.     end;
  52.  
  53. end; {CheckCmdLine}
  54.  
  55. {***}
  56.  
  57. begin
  58.  
  59.   CheckCmdLine;
  60.   MNW.Init (true);
  61.   if MNW.FileServerExists (paramstr (1)) then
  62.     writeln ('Server ', MNW.UppercaseNW (paramstr (1)), ' can be seen on the network.')
  63.   else
  64.     writeln ('Server ', MNW.UppercaseNW (paramstr (1)), ' cannot be seen on the network!');
  65.  
  66.   MNW.Done;
  67.  
  68. end.